<?php

use think\facade\Route;

Route::miss(function () {
    return \think\facade\View::fetch(app()->getBasePath() . '/error/empty.html', [
        'msg' => '没有匹配到正确路由：' . request()->url(),
    ]);
});

//首页
Route::get('/', 'index/index')->middleware('verify');

//上传
Route::group('uploads', function () {
    Route::rule('/uploadImage', 'uploads/uploadImage');
    Route::rule('/uploadImageMaterial', 'uploads/uploadImageMaterial');
    Route::rule('/uploadEditorVideo', 'uploads/uploadEditorVideo');
})->ext('html');

//定时测试
Route::group('test', function () {
    $graft = '\addons\Builder\driver\TableTool@';
    Route::get('/index', $graft . 'test');
    Route::post('/execute', $graft . 'execute');
})->middleware('verify')->ext('html');


Route::group('index', function () {
    Route::get('/index', 'index/index');
    Route::get('/welcome', 'index/welcome');
    Route::get('/clear_cache', 'index/clear_cache');
})->middleware('verify')->ext('html');

//登录
Route::group('login', function () {
    Route::get('/index', 'login/index');
    Route::post('/check', 'login/check');
    Route::post('/logout', 'login/logout');
})->ext('html');

//我的桌面
Route::group('desktop', function () {
    Route::get('/index', 'desktop/statistics');
})->middleware('verify')->ext('html');

//会员管理
Route::group('user', function () {
    Route::get('/ordinary', 'user/ordinary');
    Route::get('/formal', 'user/formal');
    Route::get('/add', 'user/add');
    Route::get('/edit', 'user/edit');
    Route::post('/reset', 'user/reset');
    Route::post('/save', 'user/save');
    Route::post('/login', 'user/login');
    Route::rule('/recharge', 'user/recharge', 'POST|GET');
    Route::get('/export', 'user/export');
    Route::get('/getList', 'user/getList');
    Route::get('/getLevel', 'user/getLevel');
    Route::get('/login', 'user/login');
    Route::post('/update', 'user/update');
    Route::post('/delete', 'user/delete');
})->middleware('verify')->ext('html');

//推荐关系
Route::group('relation', function () {
    Route::get('/index', 'relation/index');
    Route::get('/algebra', 'relation/algebra');
    Route::get('/getData', 'relation/getData');
})->middleware('verify');

Route::group('place', function () {
    Route::get('/index', 'place/index');
    Route::get('/algebra', 'place/algebra');
    Route::get('/getData', 'place/getData');
})->middleware('verify');

//财务管理
Route::group('account', function () {
    Route::get('/index', 'account/index');
    Route::get('/recharge', 'account/recharge');
    Route::get('/bonus', 'account/bonus');
    Route::get('/add', 'account/add');
    Route::get('/edit', 'account/edit');
    Route::get('/export', 'account/export');
    Route::get('/getList', 'account/getList');
})->middleware('verify');

//充值管理
Route::group('remit', function () {
    Route::get('/index', 'remit/index');
    Route::get('/add', 'remit/add');
    Route::get('/edit', 'remit/edit');
    Route::get('/export', 'remit/export');
    Route::get('/getList', 'remit/getList');
    Route::post('/save', 'remit/save');
    Route::post('/batch', 'remit/batch');
})->middleware('verify');

//提现管理
Route::group('draw', function () {
    Route::get('/index', 'draw/index');
    Route::get('/add', 'draw/add');
    Route::get('/edit', 'draw/edit');
    Route::get('/export', 'draw/export');
    Route::get('/getList', 'draw/getList');
    Route::post('/save', 'draw/save');
    Route::post('/batch', 'draw/batch');
})->middleware('verify');

//转账管理
Route::group('transfer', function () {
    Route::get('/index', 'transfer/index');
    Route::get('/export', 'remit/export');
    Route::get('/getList', 'transfer/getList');
})->middleware('verify');

//转换管理
Route::group('exchange', function () {
    Route::get('/index', 'exchange/index');
    Route::get('/export', 'exchange/export');
    Route::get('/getList', 'exchange/getList');
})->middleware('verify');

//奖金管理
Route::group('summaryUser', function () {
    Route::get('/index', 'summaryUser/index');
    Route::get('/getList', 'summaryUser/getList');
    Route::get('/export', 'summaryUser/export');
    Route::get('/summary_info', 'summaryUser/summary_info');
})->middleware('verify');

//奖金管理
Route::group('summaryDate', function () {
    Route::get('/index', 'summaryDate/index');
    Route::get('/getList', 'summaryDate/getList');
    Route::get('/export', 'summaryDate/export');
    Route::get('/summary_info', 'summaryDate/summary_info');
})->middleware('verify');

//新闻公告
Route::group('news', function () {
    Route::get('/index', 'news/index');
    Route::get('/getList', 'news/getList');
    Route::get('/add', 'news/add');
    Route::get('/edit', 'news/edit');
    Route::get('/export', 'news/export');
    Route::post('/save', 'news/save');
    Route::post('/update', 'news/update');
    Route::post('/delete', 'news/delete');
})->middleware('verify');

//轮播管理
Route::group('carousel', function () {
    Route::get('/index', 'carousel/index');
    Route::get('/getList', 'carousel/getList');
    Route::get('/add', 'carousel/add');
    Route::get('/edit', 'carousel/edit');
    Route::post('/save', 'carousel/save');
    Route::post('/update', 'carousel/update');
    Route::post('/delete', 'carousel/delete');
})->middleware('verify');


//留言管理
Route::group('message', function () {
    Route::get('/index', 'message/index');
    Route::get('/getList', 'message/getList');
    Route::get('/add', 'message/add');
    Route::get('/edit', 'message/edit');
    Route::post('/save', 'message/save');
})->middleware('verify');

//消息管理
Route::group('notice', function () {
    Route::get('/group', 'notice/group');
    Route::get('/getData', 'notice/getData');
    Route::get('/show_order', 'notice/show_order');
    Route::get('/show_user', 'notice/show_user');
    Route::get('/show_message', 'notice/show_message');
    Route::get('/all_read', 'notice/all_read');
    Route::get('/noticeCount', 'notice/noticeCount');
})->middleware('verify');


//菜单管理
Route::group('menu', function () {
    Route::get('/index', 'menu/index');
    Route::get('/getList', 'menu/getList');
    Route::get('/add', 'menu/add');
    Route::get('/edit', 'menu/edit');
    Route::post('/save', 'menu/save');
    Route::get('/updateStatus', 'menu/updateStatus');
    Route::rule('/update', 'menu/update');
    Route::post('/delete', 'menu/delete');
})->middleware('verify');

//快递管理
Route::group('express', function () {
    Route::get('/index', 'express/index');
    Route::get('/getList', 'express/getList');
    Route::get('/add', 'express/add');
    Route::get('/edit', 'express/edit');
    Route::post('/save', 'express/save');
    Route::post('/update', 'express/update');
    Route::post('/delete', 'express/delete');
})->middleware('verify');

//网站配置
Route::group('config', function () {
    Route::get('/index', 'config/index');
    Route::get('/getList', 'config/getList');
    Route::get('/add', 'config/add');
    Route::get('/edit', 'config/edit');
    Route::post('/save', 'config/save');
    Route::post('/update', 'config/update');
    Route::post('/delete', 'config/delete');
    Route::get('/create', 'config/create');
    Route::post('/saveGroup', 'config/saveGroup');
})->middleware('verify');

//角色管理
Route::group('role', function () {
    Route::get('/index', 'role/index');
    Route::get('/getList', 'role/getList');
    Route::get('/add', 'role/add');
    Route::get('/edit', 'role/edit');
    Route::post('/save', 'role/save');
    Route::post('/update', 'role/update');
    Route::post('/delete', 'role/delete');
    Route::rule('/give', 'role/give');
})->middleware('verify');

//用户列表
Route::group('admin', function () {
    Route::get('/index', 'admin/index');
    Route::get('/getList', 'admin/getList');
    Route::get('/add', 'admin/add');
    Route::get('/edit', 'admin/edit');
    Route::post('/save', 'admin/save');
    Route::post('/update', 'admin/update');
    Route::post('/delete', 'admin/delete');
    Route::rule('/password', 'admin/password');
})->middleware('verify');


//数据管理
Route::group('backup', function () {
    Route::get('/index', 'backup/index');
    Route::get('/add', 'backup/add');
    Route::get('/import', 'backup/import');
    Route::get('/clear', 'backup/clear');
    Route::get('/backup', 'backup/delete');
})->middleware('verify');

//操作日志
Route::group('logs', function () {
    Route::get('/index', 'logs/index');
    Route::get('/getList', 'logs/getList');
    Route::get('/queryIp', 'logs/queryIp');
})->middleware('verify');


//插件管理
Route::group('addons', function () {
    Route::get('/index', '\addons\Plugin@index');
    Route::get('/getList', '\addons\Plugin@getList');
    Route::post('/install', '\addons\Plugin@install');
    Route::post('/uninstall', '\addons\Plugin@uninstall');
    Route::post('/locking', '\addons\Plugin@locking');
    Route::post('/update', '\addons\Plugin@update');
})->middleware('verify')->ext('html');

//会员级别
Route::group('level', function () {
    Route::get('/index', 'level/index');
    Route::get('/getList', 'level/getList');
    Route::get('/add', 'level/add');
    Route::get('/edit', 'level/edit');
    Route::post('/save', 'level/save');
    Route::post('/update', 'level/update');
    Route::post('/delete', 'level/delete');
})->middleware('verify');

Route::group('agentBonus', function () {
    Route::get('/index', 'agentBonus/index');
    Route::get('/getList', 'agentBonus/getList');
    Route::get('/add', 'agentBonus/add');
    Route::get('/edit', 'agentBonus/edit');
    Route::post('/save', 'agentBonus/save');
    Route::post('/update', 'agentBonus/update');
    Route::post('/delete', 'agentBonus/delete');
    Route::post('/bonus', 'agentBonus/bonus');
})->middleware('verify');

//文章分类
Route::group('articleCate', function () {
    Route::get('/index', 'articleCate/index');
    Route::get('/getList', 'articleCate/getList');
    Route::get('/add', 'articleCate/add');
    Route::get('/edit', 'articleCate/edit');
    Route::post('/save', 'articleCate/save');
    Route::post('/update', 'articleCate/update');
    Route::post('/delete', 'articleCate/delete');
})->middleware('verify');

//文章列表
Route::group('article', function () {
    Route::get('/index', 'article/index');
    Route::get('/getList', 'article/getList');
    Route::get('/add', 'article/add');
    Route::get('/edit', 'article/edit');
    Route::post('/save', 'article/save');
    Route::post('/update', 'article/update');
    Route::post('/delete', 'article/delete');
})->middleware('verify');

//视频列表
Route::group('video', function () {
    Route::get('/index', 'video/index');
    Route::get('/getList', 'video/getList');
    Route::get('/add', 'video/add');
    Route::get('/edit', 'video/edit');
    Route::post('/save', 'video/save');
    Route::post('/update', 'video/update');
    Route::post('/delete', 'video/delete');
})->middleware('verify');

//银行管理
Route::group('bank', function () {
    Route::get('/index', 'bank/index');
    Route::get('/getList', 'bank/getList');
    Route::get('/add', 'bank/add');
    Route::get('/edit', 'bank/edit');
    Route::post('/save', 'bank/save');
    Route::post('/update', 'bank/update');
    Route::post('/delete', 'bank/delete');
})->middleware('verify');


//释放列表
Route::group('userRelease', function () {
    Route::get('/index', 'userRelease/index');
    Route::get('/getList', 'userRelease/getList');
})->middleware('verify');
